<!doctype html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>登录</title>
<link rel="stylesheet" type="text/css" href="../public/css/back-login.css">
</head>
<body>
<div class="htmleaf-container">
	<div class="wrapper">
		<div class="container">
			<h1>博客管理后台</h1>
			<div id="error"></div>
			<form class="form" action="loginact.php" method="post" id="loginform">
				<input type="text" name="name" placeholder="管理员">
				<input type="password" name="password" placeholder="密码">
				<button type="submit" id="login-button">登录</button>
			</form>
		</div>
		
		<ul class="bg-bubbles">
			<li></li>
			<li></li>
			<li></li>
			<li></li>
			<li></li>
			<li></li>
			<li></li>
			<li></li>
			<li></li>
			<li></li>
		</ul>
	</div>
</div>

<script src="../public/js/jquery-2.1.1.min.js" type="text/javascript"></script>
<script>
$('#loginform').submit(function (event) {
	// event.preventDefault();
	$('#loginform').fadeOut(500);
	$('.wrapper').addClass('form-success');
	setTimeout(function(){
		$.ajax({
			type:'post',
			url:$('#loginform').attr('action'),
			data:$('#loginform').serialize(),
			dataType:'json',
			success:function(data){
				if(data.code=='000'){
					window.location="index.php";
				}else{
					$('.wrapper').removeClass('form-success');
					$('#loginform').fadeIn(500);
					$('#error').html(data.msg);
				}
			}
		});
	},600);
	
	return false;
});
</script>

<div style="text-align:center;margin:50px 0; font:normal 14px/24px 'MicroSoft YaHei';color:#000000">
</div>
</body>
</html>